<template>
	<view class="setup">
		<view class="order_title" @click="aboutme">
			<view class="title_left">
				关于我们
			</view>
			<view class="title_right">
				
			</view>
		</view>
		<view class="order_title" @click="agreement">
			<view class="title_left">
				用户协议
			</view>
			<view class="title_right">
				
			</view>
		</view>
		<view class="order_title" @click="Informationreminder">
			<view class="title_left">
				信息提醒
			</view>
			<view class="title_right">
				
			</view>
		</view>
		<view class="order_title" @click="del">
			<view class="title_left">
				清除缓存
			</view>
			<view class="title_right">
				{{a}}KB
			</view>
		</view>
		<view class="button">
			<button type="warn" @click="addmanagement">退出登录</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				a:''
			};
		},
		methods:{
			Informationreminder(){
				uni.navigateTo({
					url:'./Informationreminder'
				})
			},
			agreement(){
				uni.navigateTo({
					url:'./agreement'
				})
			},
			aboutme(){
				uni.navigateTo({
					url:'./aboutme'
				})
			},
			del(){
				 uni.removeStorageSync('customer_id');
				 uni.removeStorageSync('content');
				 uni.removeStorageSync('address_id');
				 uni.removeStorageSync('goods_id');
				 uni.removeStorageSync('TotalPrice');
				 uni.removeStorageSync('order');
				 uni.showToast({
				 	title:'缓存清楚成功！'
				 })
				 let _this=this
				 uni.getStorageInfo({
				     success: function (res) {
				 		_this.a=res.currentSize
				     }
				 });
			},
			addmanagement(){
				uni.clearStorageSync();
				uni.showToast({
					title:'已退出登陆'
				})
				uni.switchTab({
				    url: '/pages/home/home/home'
				});
			}
		},
		onShow() {
			let _this=this
			uni.getStorageInfo({
			    success: function (res) {
					_this.a=res.currentSize
			    }
			});
		}
	}
</script>

<style lang="less">
	.setup{
		height: 100%;
		background: #F3F4F5;
		padding-top:20rpx ;
		.order_title{
			display: flex;
			justify-content: space-between;
			padding: 20rpx 40rpx;
			border-bottom:1px solid #EEEEEE;
			background: url(@/static/direction_right_gray.png)no-repeat 690rpx 22rpx ;
			background-size: 28rpx 28rpx;
			background-color: #fff;
			.title_left{
				font-size: 28rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #111111;
			}
			.title_right{
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #9DA5A8;
				padding-right: 30rpx;
			}
		}
		.button {
				width: 90%;
				margin: 0 auto;
				padding: 40rpx 0;
				button{
					border-radius: 20px;
					line-height: 80rpx;
					background: #F3F4F5;
					border: 1px solid #DB1B22;
					color: #DB1B22;
				}
			}
	}
</style>
